# Maintainer: Florian Pritz <flo@xinu.at>
# Contributor: Sven Kauber <celeon@gmail.com>

pkgname=siege
pkgver=4.1.6
pkgrel=1
arch=('loong64' 'x86_64')
license=('GPL')
pkgdesc="An http regression testing and benchmarking utility"
url="https://www.joedog.org/siege-home/"
depends=('openssl')
optdepends=('perl: siege2csv.pl')
backup=(etc/siegerc etc/urls.txt)
source=("http://download.joedog.org/siege/siege-${pkgver}.tar.gz")
md5sums=('4104ab483f11519f25dded58606c7337')
sha256sums=('309d589bfc819b6f15d2e5e8591b3c0c6f693624f5060eeac067a4d9a7757de9')

build() {
  cd "${srcdir}/$pkgname-$pkgver"
  ./configure --prefix=/usr --sysconfdir=/etc --mandir=/usr/share/man
  make
}

package() {
  cd "${srcdir}/$pkgname-$pkgver"

  install -d -m755 "$pkgdir/etc"
  install -d -m755 "$pkgdir/usr/share"
  make DESTDIR="$pkgdir" install
  sed -i 's/^# file =$/file = \/etc\/urls.txt/' "$pkgdir/etc/siegerc"
}
